// 引入 createStore 用于创建最核心的 store 对象
// applyMiddleware 引入执行中间件，支持异步 action（store会帮你执行函数）
import { createStore, applyMiddleware } from 'redux'

// 引入 thunk 用于支持异步 action
import thunk from 'redux-thunk'

import { composeWithDevTools } from 'redux-devtools-extension'
// 引入为 store 服务的 reducer
import rootReducer from './reducers'

const middlewares = composeWithDevTools(applyMiddleware(thunk))
// 
const store = createStore(rootReducer, middlewares)

//暴露store 
export default store